package com.project.service.imp;

import com.project.bean.SaleCartBean;
import com.project.bean.SaleDetailBean;
import com.project.bean.SaleOrderBean;
import com.project.mapper.ISaleCartMapper;
import com.project.mapper.ISaleDetailMapper;
import com.project.mapper.ISaleOrderMapper;
import com.project.service.ISaleDetailService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class SaleDetailServiceImp implements ISaleDetailService {
    @Autowired
    private ISaleDetailMapper mapper;
    @Autowired
    private ISaleCartMapper saleCartMapper;
    @Override
    public void addDetailList(Integer orderId,Integer userId) {
        //查询购物车集合
        mapper.addDetailList(orderId,saleCartMapper.findById(userId));
    }

    @Override
    public SaleOrderBean findById(Integer id) {
        return mapper.findById(id);
    }
}
